﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp2
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void label4_Click(object sender, EventArgs e)
        {

        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }

        private void label3_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            var uid = textBox1.Text;
            var pwd = textBox2.Text;
            var pwd2 = textBox3.Text;


            var uid1 = !string.IsNullOrEmpty(uid);
            var pwd1 = !string.IsNullOrEmpty(pwd);
            var repwd = pwd == pwd2;
            if (uid1 && pwd1 && repwd)
            { 
                MessageBox.Show("注册成功");
                Form1.users.Add(uid, pwd);
                this.Hide();
                Form1 form1 = new Form1();
                form1.Show();
               
                
            }
            else
            {
                MessageBox.Show("注册失败,请重新注册");
                this.Close();
                Form3 form3 = new Form3();
                form3.Show();
            }
        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
            Form1 form1 = new Form1();
            form1.Show();
        }
    }
}
